Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> #myDIV { width: 500px; background-color: lightblue; overflow: auto; } </style> </head> <body> <p>Click the "Try it" button to alert the max-height of the DIV element:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV" style="max-height:100px;"> <p>This DIV element does not have a pre-defined height.</p> <p>The height of this DIV element depends on its content.</p> <p>But the DIV element has a max-height, and will never exceed 100 pixels.</p> </div> <script> function myFunction() { alert(document.getElementById("myDIV").style.maxHeight); } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_maxheight2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:25:42 GMT --> </html>
Result:
Try it Yourself - © w3schools.com